apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres
  namespace: {{ .Values.namespace }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
        - name: postgres
          image: postgres:14.1-alpine
          env:
            - name: POSTGRES_DB
              value: chroma
            - name: POSTGRES_USER
              value: chroma
            - name: POSTGRES_PASSWORD
              value: chroma
          ports:
            - containerPort: 5432
---
apiVersion: v1
kind: Service
metadata:
  name: postgres
  namespace: {{ .Values.namespace }}
spec:
  ports:
    - name: postgres-port
      port: 5432
      targetPort: 5432
  selector:
    app: postgres
  type: ClusterIP
